/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.mes.action.produce;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.mes.mapper.produce.HolderToolMapper;
public class HolderTool extends BaseAction
{
    @Autowired(required=false)
	private HolderToolMapper mapper;
    /**
    磨具夹具
    */
    
    public Map holderTool() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_device_abrasives=mapper.s_device_abrasives(params);
        result.put("s_device_abrasives", s_device_abrasives);
        
        
        SQLList<SQLMap> s_device_abrasives1=mapper.s_device_abrasives1(params);
        result.put("s_device_abrasives1", s_device_abrasives1);
        
        return result;
    }
    /**
    成套关联
    */
    
    public Map complete() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_relat=mapper.s_relat(params);
        result.put("s_relat", s_relat);
        
        
        SQLList<SQLMap> t_device=mapper.t_device(params);
        SQLMap t_device_emt=t_device.getExistfirst();
        result.put("t_device", t_device_emt);
        
        return result;
    }
    /**
    添加关联设备
    */
    
    public Map deviceRelation() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        SQLList<SQLMap> s_device=mapper.s_device(params,pagination);
        s_device.setPagedListInfo(pagination);
        result.put("s_device", s_device);
        
        
        SQLList<SQLMap> s_relat=mapper.s_relat(params);
        result.put("s_relat", s_relat);
        
        
        SQLList<SQLMap> t_device=mapper.t_device(params);
        SQLMap t_device_emt=t_device.getExistfirst();
        result.put("t_device", t_device_emt);
        
        return result;
    }
    /**
    修改磨具
    */
    
    public Map holderToolUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_device_abrasives=mapper.s_device_abrasives(params);
        SQLMap s_device_abrasives_emt=s_device_abrasives.getExistfirst();
        result.put("s_device_abrasives", s_device_abrasives_emt);
        
        return result;
    }
    /**
    增加夹具
    */
    
    public Map fixtureAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        return result;
    }
    /**
    修改夹具
    */
    
    public Map fixtureUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_device_abrasives=mapper.s_device_abrasives(params);
        SQLMap s_device_abrasives_emt=s_device_abrasives.getExistfirst();
        result.put("s_device_abrasives", s_device_abrasives_emt);
        
        return result;
    }
    /**
    增加磨具修改
    */
    
    public Map holderToolAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_device_abrasives = mapper.i_device_abrasives(params);
        result.put("i_device_abrasives", i_device_abrasives);
        
        return result;
    }
    /**
    */
    
    public Map d_relat() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_relat(params);
        
        return result;
    }
    /**
    添加关联设备修改
    */
    
    public Map deviceRelationSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("device_relat")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_relat(params);
        }
        
        
        int u = mapper.u(params);
        result.put("u", u);
        
        return result;
    }
    /**
    修改磨具修改
    */
    
    public Map holderToolUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int u_device_abrasives = mapper.u_device_abrasives(params);
        result.put("u_device_abrasives", u_device_abrasives);
        
        return result;
    }
    /**
    增加夹具修改
    */
    
    public Map fixtureAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_device_abrasives = mapper.i_device_abrasives(params);
        result.put("i_device_abrasives", i_device_abrasives);
        
        return result;
    }
    /**
    修改夹具修改
    */
    
    public Map fixtureUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int u_device_abrasives = mapper.u_device_abrasives(params);
        result.put("u_device_abrasives", u_device_abrasives);
        
        return result;
    }
}